package io.gitee.chearnee.fw.log.sql.parse;

import io.gitee.chearnee.fw.log.sql.model.entity.SqlVO;
import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;

/**
 * 打印简单工具类
 *
 * @author lk
 * @version 1.0
 * @date 2020/8/23 17:14
 */
@Slf4j
@UtilityClass
public class PrintlnUtil {
    public static void prints(SqlVO sqlVO) {
        if (null != sqlVO) {
            String completesql = sqlVO.getCompleteSql().replaceAll("\t|\r|\n", "");
            final String id = sqlVO.getId();
            final String parameter = sqlVO.getParameter();
            sqlVO.parse();
            log.info("==> mapperId:{}\n==> completesql:{}\n==> parameter:{}", id, completesql, parameter);
        }
    }
}
